/*    */ package blockbuster.components.shape;
/*    */ 
/*    */ import blockbuster.emitter.BedrockEmitter;
/*    */ import blockbuster.emitter.BedrockParticle;
/*    */ 
/*    */ 
/*    */ public class BedrockComponentShapeEntityAABB
/*    */   extends BedrockComponentShapeBase
/*    */ {
/*    */   public void apply(BedrockEmitter emitter, BedrockParticle particle) {
/* 11 */     float centerX = (float)this.offset[0].get();
/* 12 */     float centerY = (float)this.offset[1].get();
/* 13 */     float centerZ = (float)this.offset[2].get();
/*    */     
/* 15 */     float w = 0.0F;
/* 16 */     float h = 0.0F;
/* 17 */     float d = 0.0F;
/*    */     
/* 19 */     if (emitter.target != null) {
/*    */       
/* 21 */       w = emitter.target.field_70130_N;
/* 22 */       h = emitter.target.field_70131_O;
/* 23 */       d = emitter.target.field_70130_N;
/*    */     } 
/*    */     
/* 26 */     particle.position.x = (centerX + ((float)Math.random() - 0.5F) * w);
/* 27 */     particle.position.y = (centerY + ((float)Math.random() - 0.5F) * h);
/* 28 */     particle.position.z = (centerZ + ((float)Math.random() - 0.5F) * d);
/*    */     
/* 30 */     if (this.surface) {
/*    */       
/* 32 */       int roll = (int)(Math.random() * 6.0D * 100.0D) % 6;
/*    */       
/* 34 */       if (roll == 0) { particle.position.x = (centerX + w / 2.0F); }
/* 35 */       else if (roll == 1) { particle.position.x = (centerX - w / 2.0F); }
/* 36 */       else if (roll == 2) { particle.position.y = (centerY + h / 2.0F); }
/* 37 */       else if (roll == 3) { particle.position.y = (centerY - h / 2.0F); }
/* 38 */       else if (roll == 4) { particle.position.z = (centerZ + d / 2.0F); }
/* 39 */       else if (roll == 5) { particle.position.z = (centerZ - d / 2.0F); }
/*    */     
/*    */     } 
/* 42 */     this.direction.applyDirection(particle, centerX, centerY, centerZ);
/*    */   }
/*    */ }


/* Location:              D:\fanbian\[D][龙之核心]DragonCore-2.6.0.3.jar!\blockbuster\components\shape\BedrockComponentShapeEntityAABB.class
 * Java compiler version: 8 (52.0)
 * JD-Core Version:       1.1.3
 */